package com.cal.utms.action.payment;

import java.util.List;

import com.cal.utms.dto.payment.BankAccountDto;
import com.cal.utms.model.payment.CommenPayementModel;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class BankAccountAction extends ActionSupport implements ModelDriven<BankAccountDto> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private BankAccountDto accountDto = new BankAccountDto();

	private CommenPayementModel model = new CommenPayementModel();

	private String customerType;
	private int customer_id;

	public String getBankAccountByCustomer() {

		List<BankAccountDto> accountDtos = model.getBankAccounts(customer_id, customerType);
		accountDto.setAccountDtos(accountDtos);
		accountDto.setSuccess(true);
		return Action.SUCCESS;
	}

	@Override
	public BankAccountDto getModel() {
		return accountDto;
	}

	public BankAccountDto getAccountDto() {
		return accountDto;
	}

	public void setAccountDto(BankAccountDto accountDto) {
		this.accountDto = accountDto;
	}

	public String getCustomerType() {
		return customerType;
	}

	public void setCustomerType(String customerType) {
		this.customerType = customerType;
	}

	public int getCustomer_id() {
		return customer_id;
	}

	public void setCustomer_id(int customer_id) {
		this.customer_id = customer_id;
	}
}
